On my home computer, a 90 MHz Pentium, after one second the largest number was 2830. If you computer is faster, you should see a larger number.
A more recent run, on my more recent 2.0 GHz computer reached 90063 after one second.
With loops, even a small program will execute thousands of statements in a few seconds. This makes it hard to figure out what is going on, sometimes. Pausing a program (by hitting the PAUSE key) is useful, but you have to be fast to see just a few statements execute.
In QBasic you can execute just one statement at a time by hitting the F8 key. Say you have the previous program:
' Counting up LET COUNT = 0 'Statement 1 DO 'Statement 2 PRINT COUNT 'Statement 3 LET COUNT = COUNT + 1 'Statement 4 LOOP 'Statement 5 END
Do the following to execute statements one at a time:
LET COUNT = 0
,
will be highlighted.DO
) will be highlighted.These are bothersome details. But they sometimes are very useful, so don't forget about them. (It is a really good idea to type in the program and do these steps. Just reading about it doesn't have the same impact as seeing the program running.)
Say that Statement 5, LOOP
, is highlighted.
When you push F8:
What statement will be highlighted at this time?